use serde::{Deserialize, Serialize};

use crate::graph::value::Value;

#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct InputData {
    pub name: String,
    pub description: Option<String>,
    pub value: Value,
}

#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct OutputData {
    pub name: String,
    pub description: Option<String>,
    pub value: Value,
}

#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct NodeData {
    pub name: String,
    pub description: Option<String>,
    pub inputs: Vec<InputData>,
    pub outputs: Vec<OutputData>,
    pub children_count: Option<usize>,
    pub menu: Option<String>,
    pub ty: String,
    pub has_children: bool,
}

#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct GraphData {
    pub nodes: Vec<NodeData>
}

pub trait GraphDataGenerator {
    fn generate(&self) -> GraphData;
}
